<#ftl strip_whitespace=true>

<#--字符串截取 -->
<#macro strsub str len>
	<#if str?length lte len >
	   ${str}
	<#else>
	   ${str[0..len]}...
	</#if>
</#macro>

<#--字符串截取 -->
<#macro substr str len>
	<#if str?length lte len >
	   ${str}
	<#else>
	   ${str[0..len]}
	</#if>
</#macro>

<#macro page_links page url lastChar>
   <#assign pageNo=page.pageNo>  <#--当前页码 -->
   <#assign pageSum=page.totalPages>  <#--总页数 -->
   <#if pageSum gt 1>
	   <#assign liststep = 6 >  <#--显示分页页数  -->
	   <#if pageNo lt 1 >
	     <#assign pageNo=1>	<#-- 如果分页变量小于１,则将分页变量设为１-->
	   </#if>
	   <#assign bar = liststep/2 >
	   <#if (pageNo-bar) lt 1 >
	       <#assign listbegin=1>
	   <#else>
		   <#assign listbegin=pageNo-bar>  <#-- 分页信息开始显示到第几页-->
	   </#if>
	   <#assign listend = pageNo + bar>     <#-- 分页信息结束显示到第几页-->
		
		<#if listend gt pageSum > 
		  <#assign listend=pageSum>         <#-- 分页信息结束显示超过了总页数处理 -->
		</#if>
		
		<@link_to_previous_page page,url,lastChar />		<#-- 显示上一页处理-->
		<#if  listbegin gt 1>					<#-- 第一页控制-->
		   <@link_to_page 1,page,url,lastChar/><span class="dot">···</span>
		</#if>
		<#list listbegin..listend as i>
			<#if i lte pageSum>				<#-- 分页码的显示-->
				<@link_to_page i,page,url,lastChar/>
			</#if>
		</#list>
		<@link_to_next_page page,url,lastChar/>			<#-- 显示下一页处理-->
	</#if>
</#macro>

<#macro link_to_previous_page page url lastChar>
  <#if page.pageNo gt 1 >
    <#assign prev_start = page.pageNo-1 >
    <a href="<@url_for_start url,prev_start,lastChar/>">上一页</a>
  </#if>
</#macro>

<#macro link_to_page pageNo page url lastChar>
  <#if pageNo == page.pageNo>
    <a class="one" href="<@url_for_start url,pageNo,lastChar/>">${pageNo}</a>
  <#else>
	    <#if pageNo <= page.totalPages>
	      <a href="<@url_for_start url,pageNo,lastChar/>">${pageNo}</a>
	    </#if>
   </#if>
</#macro>

<#macro  link_to_next_page page url lastChar>
  <#if page.pageNo < page.totalPages >
    <#assign next_start = page.pageNo+1 >
    <a href="<@url_for_start url,next_start,lastChar/>">下一页</a>
  </#if>
</#macro>

<#macro url_for_start url start lastChar>${url}${start}${lastChar}</#macro>

<#--是否显示最新的表示 -->
<#macro mark_new dt>
    <#assign aDateTime = .now>
    <#assign now=aDateTime?date>
    <#assign odt=dt?date>
    <#assign snow=now?string.short>
    <#assign sodt=odt?string.short>
    <#if (snow==sodt)><img src="/b2b/imgs/new4.gif" title="最新" /></#if>
</#macro>





<#macro smiles message>${message?replace("[呵呵]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_mrgreen.gif\" alt=\"呵呵\"/>")
	?replace("[色]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_razz.gif\" alt=\"色\" />")
	?replace("[伤心]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_sad.gif\" alt=\"伤心\" />")
	?replace("[微笑]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_smile.gif\" alt=\"微笑\" />")
	?replace("[惊讶]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_redface.gif\" alt=\"惊讶\" />")
	?replace("[示爱]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_biggrin.gif\" alt=\"示爱\" />")
	?replace("[惊吓]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_surprised.gif\" alt=\"惊吓\" />")
	?replace("[晕]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_confused.gif\" alt=\"晕\" />")
	?replace("[酷]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_cool.gif\" alt=\"酷\" />")
	?replace("[坏笑]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_lol.gif\" alt=\"坏笑\" />")
	?replace("[抓狂]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_mad.gif\" alt=\"抓狂\" />")
	?replace("[哈哈]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_twisted.gif\" alt=\"哈哈\" />")
	?replace("[希望]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_rolleyes.gif\" alt=\"希望\" />")
	?replace("[吃饭]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_wink.gif\" alt=\"吃饭\" />")
	?replace("[馋]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_idea.gif\" alt=\"馋\" />")
	?replace("[糗大了]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_arrow.gif\" alt=\"糗大了\" />")
	?replace("[淡定]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_neutral.gif\" alt=\"淡定\" />")
	?replace("[流泪]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_cry.gif\" alt=\"流泪\" />")
	?replace("[冷汗]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_question.gif\" alt=\"冷汗\" />")
	?replace("[闭嘴]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_evil.gif\" alt=\"闭嘴\" />")
	?replace("[饿了]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_eek.gif\" alt=\"饿了\" />")
	?replace("[做鬼脸]","<img class=\"wp-smiley\" src=\"http://zdmya.oss-cn-hangzhou.aliyuncs.com/images/smiles/icon_exclaim.gif\" alt=\"做鬼脸\" />")}</#macro>

